package config

type Config struct {
	DB struct {
		Username string `json:"username"`
		Password string `json:"password"`
		Host     string `json:"host"`
		Port     string `json:"port"`
		Database string `json:"database"`
	} `json:"db"`
	Server struct {
		Port string `json:"port"`
	} `json:"server"`
}

var AppConfig Config

func LoadConfig() {
	// 这里可以改为从文件或环境变量加载
	AppConfig.DB.Username = "root"
	AppConfig.DB.Password = "root"
	AppConfig.DB.Host = "localhost"
	AppConfig.DB.Port = "3308"
	AppConfig.DB.Database = "apijson"
	AppConfig.Server.Port = "8080"
}
